
package com.rt.schedulenew.utils.checkparam.common;
import org.aspectj.lang.reflect.MethodSignature;
import org.aspectj.lang.ProceedingJoinPoint;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
public class BaseUtil
{
    public static final String SEPARATOR = ":";
    
    public static Boolean isCheck(final Method method, final Object[] arguments, final Class<? extends Annotation> annotationClass) {
        Boolean isCheck = Boolean.TRUE;
        if (!method.isAnnotationPresent(annotationClass) || arguments == null) {
            isCheck = Boolean.FALSE;
        }
        return isCheck;
    }
    
    public static Method getMethod(final ProceedingJoinPoint joinPoint) {
        final MethodSignature signature = (MethodSignature)joinPoint.getSignature();
        Method method = signature.getMethod();
        if (method.getDeclaringClass().isInterface()) {
            try {
                method = joinPoint.getTarget().getClass().getDeclaredMethod(joinPoint.getSignature().getName(), method.getParameterTypes());
            }
            catch (SecurityException | NoSuchMethodException ex2) {
                ex2.printStackTrace();
            }
        }
        return method;
    }
}
